package com.example.task1.ui.AllService.bus;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.example.task1.R;
import com.example.task1.bean.BusPathDetailsBean;
import com.example.task1.ui.BaseAdapter;

import java.util.ArrayList;
import java.util.List;

public class BusPathAdapter extends BaseAdapter<BusPathDetailsBean.RowsDTO> {

    private List<BusPathDetailsBean.RowsDTO> mData;
    private Context context;
    private TextView tvName;

    public BusPathAdapter(Context context,List<BusPathDetailsBean.RowsDTO> rows) {
        this.context = context;
        mData = rows;
    }

    @Override
    protected void setData(List<BusPathDetailsBean.RowsDTO> rows) {
    }

    @Override
    protected int getLayout() {
        return R.layout.buspathdetails;
    }

    @Override
    protected Context getContext() {
        return null;
    }

    @Override
    protected List<BusPathDetailsBean.RowsDTO> getData() {
        return mData;
    }

    @Override
    protected void onBind(myHolder holder, BusPathDetailsBean.RowsDTO date) {
        tvName.setText(date.getName());
    }

    @Override
    protected void holder(View itemView) {
        initView(itemView);
    }

    private void initView(View view) {
        tvName = (TextView) view.findViewById(R.id.tv_name);
    }
}
